package com.han.hotelplat.model;

public class AreaModel {

	private String code;//编码是6位数， 前2代表省份 中2代表城市  后2代表区域
	private String name;
	
	private byte level;//0,国家，1,省；2,市；3,区域
	
	//不然等下序列化很多数据了
	private transient AreaModel parent;
	//不然等下序列化很多数据了
	private transient AreaModel[] childs;
	
	
	
	public AreaModel(String code, String name, byte level, AreaModel parent, AreaModel[] childs) {
		this.code = code;
		this.name = name;
		this.level = level;
		this.parent = parent;
		this.childs = childs;
	}
	public boolean isProvince() {
		return level==1;
	}
	public boolean isCity() {
		return level==2;
	}
	public boolean isDistrict() {
		return level==3;
	}
	
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public AreaModel getParent() {
		return parent;
	}
	public void setParent(AreaModel parent) {
		this.parent = parent;
	}
	public byte getLevel() {
		return level;
	}
	public void setLevel(byte level) {
		this.level = level;
	}
	public AreaModel[] getChilds() {
		return childs;
	}
	public void setChilds(AreaModel[] childs) {
		this.childs = childs;
	}
	
	
	
	
}
